package com.kusen.text;

import java.util.regex.Pattern;

public class DataText {
    public static void main(String[] args) {
        String date = "2020-1x-20";
        System.out.println(date.substring(4, 5));
        System.out.println(date.substring(7, 8));
        String[] split = date.split("-");
        Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
        System.out.println(pattern.matcher(split[1]).matches());
    }
}
